﻿Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Security.Cryptography
Imports System.IO
Public Class desEncryptAndDecrypt

    Public Function ToBase64String(ByVal text As String) As String
        Dim plainTextBytes = Encoding.UTF8.GetBytes(text)
        Dim base64 As String = Convert.ToBase64String(plainTextBytes).Replace("+", "-").Replace("/", "_").TrimEnd("=")
        ToBase64String = base64
    End Function
End Class
